//
//  XLRequestManager.h
//  MPTinyAppLearn
//
//  Created by xl on 2019/11/7.
//  Copyright © 2019 xl. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XLNetworking.h"


@interface XLRequestConfig : NSObject

@property (nonatomic, assign) int reqId;
@property (nonatomic, copy) NSString *baseUrl;
@property (nonatomic, weak) XLURLSessionTask *requestTask;

@end


@interface XLRequestManager : NSObject

+ (XLRequestManager *)sharedInstance;

//过滤请求
- (BOOL)filterRequest:(NSString *)requestUrl;

- (int)getNextReqId;
- (void)addReqConfig:(XLRequestConfig *)reqConfig;
- (void)removeReqConfig:(int)reqId;

//取消所有请求
- (void)removeAllRequest;

- (void)cancelRequestWithReqIds:(NSArray *)reqIds;

@end

